<?php
class W4eObject{
    /**
    * A hack to support __construct() on PHP 4
    * Hint: descendant classes have no PHP4 class_name() constructors,
    * so this constructor gets called first and calls the top-layer __construct()
    * which (if present) should call parent::__construct()
    *
    */
    function W4eObject(){
        $args = func_get_args();
        register_shutdown_function(array(&$this, '__destruct'));
        call_user_func_array(array(&$this, '__construct'), $args);
    }

    /**
    * Constructor function - Overriden this method on the descendant class
    */
    function __construct() {}
    /**
    * Destructor function - Overriden this method on the descendant class
    */
    function __destructor(){}

    /**
    * Set value for a property
    */
    function set($property, $value = null){
        $this->$property = $value;
    }

    /*
    * Get Value of a property
    */
    function get($property, $default = null){
        if (isset($this->$property)){
            return $this->$property;
        }

        return $default;
    }
    /**
    * Get String of a class
    */
    function tostring(){
        return get_class($this);
    }
};
?>